package com.cw.demo.factory;

import com.cw.demo.factory.normal.SenderFactory;
import com.cw.demo.factory.statics.StaticFactory;

/**
 * TODO
 *
 * @author chenw
 * @date 2021/1/4
 */
public class SenderFactoryTest {
    public static void main(String[] args) {
        //普通工厂方法
        SenderFactory senderFactory = new SenderFactory();
        Sender sender = senderFactory.sender("mail");
        sender.send("hello world");
        //静态工厂方法
        Sender smsSender = StaticFactory.smsSender();
        smsSender.send("短信来了");
    }
}
